<#assign ctx = request.contextPath />
<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width, initial-scale=1 ,minimum-scale=1.0 ,maximum-scale=1.0" user-scalable=no>
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>服务人员评价</title>
    <link href="${ctx}/assets/css/bootstrap.min.css" rel="stylesheet">
    <link href="${ctx}/assets/css/weixing.css" rel="stylesheet" />
    <link rel="stylesheet" href="${ctx}/assets/css/sco.message.css" />
  </head>
  <body>
  	<div class="top-tx">
  			<#if driver.photo??>
	  			<img src="${ctx}/upload/driver/${driver.photo}" alt="易米" class="img-circle center-block" style="width: 60px; height: 60px; float: left;">
	  		<#else>
	  			<img src="${ctx}/assets/img/a.png" alt="易米" class="img-circle center-block" style="width: 60px; height: 60px; float: left;">
	  		</#if>
	  		<ul>
	  			<#if driver??>
	  			<li>${driver.realname?if_exists}</li>
	  			<li>${driver.driveTimes?if_exists}次<p style="float: right;">驾龄1年</p></li>
	  			</#if>
	  			<li><ul style="margin-left: 0px; padding-left: 0px;">
	  					<li style="text-align: left;">
	  						<img style="width: 14px; height: 14px;" src="${ctx}/assets/img/star-on-big.png"/>
	  						<img style="width: 14px; height: 14px;" src="${ctx}/assets/img/star-on-big.png"/>
	  						<img style="width: 14px; height: 14px;" src="${ctx}/assets/img/star-on-big.png"/>
	  						<img style="width: 14px; height: 14px;" src="${ctx}/assets/img/star-half-big.png"/>
	  						<img style="width: 14px; height: 14px;" src="${ctx}/assets/img/star-off-big.png"/>
	  					</li>
	  				</ul>
	  			</li>
	  		</ul>
	  		<div>
	  			<div id="star"> </div>
	  			<div id="star-a">&ensp;</div>
	  			<input type="hidden" name="phone" value="${phone?if_exists}">
	  		</div>	
	  		<div style="margin-top: 20px;">
	  		
	  		<div class="radio">
			  <label>
			    <input type="radio" name="evaluate" value="这个师傅服务真赞啊，赞一个。" checked="checked">
			 	   这个师傅服务真赞啊，赞一个。
			  </label>
			</div>
			<hr/ style="margin-top: 0px; margin-bottom: 0px;">
			<div class="radio">
			  <label>
			    <input type="radio" name="evaluate" value=" 非常满意，师傅态度很好。">
			 	   非常满意，师傅态度很好。
			  </label>
			</div>
			<hr/ style="margin-top: 0px; margin-bottom: 0px;">
			<div class="radio">
			  <label>
			    <input type="radio" name="evaluate" value="师傅很专业，驾驶技术熟练。">
			 	   师傅很专业，驾驶技术熟练。
			  </label>
			</div>
			<hr/ style="margin-top: 0px; margin-bottom: 0px;">
			<div class="radio">
			  <label>
			    <input type="radio" name="evaluate" value="到达时间快，服务周到。">
			 	   到达时间快，服务周到。
			  </label>
			</div>
			<hr/ style="margin-top: 0px; margin-bottom: 0px;">
			<div class="radio">
			  <label>
			    <input type="radio" name="evaluate" value="不遵守交通规则">
			 	   不遵守交通规则
			  </label>
			</div>
			<hr/ style="margin-top: 0px; margin-bottom: 0px;">
			<div class="radio">
			  <label>
			    <input type="radio" name="evaluate" value="服务好不，态度差。">
			 	  服务好不，态度差。
			  </label>
			</div>
			<hr/ style="margin-top: 0px; margin-bottom: 0px;">
			<textarea class="form-control" rows="3" placeholder="自定义" id="custom" name="custom"></textarea>
  	</div>
  	<div class="bottom">
		<button type="button" Style="margin-top:20px" class="btn btn-default btn-block" id="submit-button"><p style="margin-top: 5px">提交</p></button>
	</div>
    <script src="${ctx}/assets/js/jquery-1.11.0.min.js"></script>
    <script src="${ctx}/assets/js/bootstrap.min.js"></script>
    <script src="${ctx}/assets/js/jquery.raty.js"></script>
    <script src="${ctx}/assets/js/sco.message.js"></script>
    <script>
    	$("#star").raty({
				path: "${ctx}/assets/img",
				starOff: 'star-off-big.png',
				starOn: 'star-on-big.png',
				starHalf: 'star-half-big.png',
				size: 24,
				start: 5,
				half:true,
				targetKeep : true,
				number:5,
				score:5,
				click: function (score, evt) {
					$("#star-a").html(score+"分");
					$("#star-a").val(score);
				}
			});
			var contents;
			$("#custom").focus(function(){
				$("input[name='evaluate']:checked").removeAttr('checked');
				
			});
			
			$("#submit-button").click(function(){
				if($("#custom").val()){
					contents=$("#custom").val();
				}else{
					contents=$("input[name='evaluate']:checked").val();
				}
				var params={starLevel:$("#star-a").val(),content:contents,orderId:'${orderId?if_exists}',phone:'${phone?if_exists}'};
				$.post('${ctx}/wx/v1/driverEvaluate',params,function(data){
					if(data.success){
						alert("评价成功");
						window.location.href='${ctx}/wx/v1/historyOrder2?phone='+data.object;
					}
					else{
						$.scojs_message(data.message, $.scojs_message.TYPE_ERROR);
					}
				},'json');
					
			});
			
	</script>
  </body>
</html>
